
<body>
<nav>
  <ol class="cd-multi-steps text-bottom count">
    <li class="current"><a href="#0">病症</a></li>
    <li><em>详情</em></li>
    <li><em>诊断关系</em></li>
    <li><em>保存入库</em></li>
  </ol>
</nav>
<div class="boxx" style="text-align: center;width: 100%;">
  <h2>病情基础信息</h2>
  <div id="w" class="easyui-panel" title="添加病症（基础）" data-options="modal:true,iconCls:'icon-list'"
       style="width:500px;height:auto;margin: 0 auto;">

    <form method="post" id="ff" action="/adddetails" onsubmit="return submitForm()">
      <div>病名:</div>
      <input class="easyui-textbox" name="disease" style="width:50%;height:32px" data-options="prompt:'如：感冒'"/>
      <div>疾病描述:</div>
      <input class="easyui-textbox" name="describe" style="width:50%;height:32px" data-options="prompt:'如：感冒是一种常见病'"/>
      <div>疾病分类:</div>
      <input class="easyui-combobox" name="category" style="width:50%;" data-options="
		url:'/json/category.json',
		method:'get',
		valueField:'value',
		textField:'text'

		">
      <div>
        <div>单选病情 <a href="#" class="easyui-linkbutton" iconCls="icon-add" onclick="addsingle()">添加单选病情</a>
        </div>
        <ol id="si">
          <li>
            <input id="t1" name="single" class="easyui-textbox" style="width:50%;height:32px">
          </li>
          <li>
            <input id="t2" name="single" class="easyui-textbox" style="width:50%;height:32px">
          </li>
          <li>
            <input id="t3" name="single" class="easyui-textbox" style="width:50%;height:32px">
          </li>
          <li>
            <input id="t4" name="single" class="easyui-textbox" style="width:50%;height:32px">
          </li>
          <li>
            <input id="t5" name="single" class="easyui-textbox" style="width:50%;height:32px">
          </li>
        </ol>
        <!--<div>多选病情 <a href="#" class="easyui-linkbutton" iconCls="icon-add" onclick="addmulti()">添加多选病情</a>
        </div>
        <ol id="mu">
          <li>
            <input id="mu1" name="multiple" class="easyui-textbox" style="width:50%;height:32px">
          </li>
          <li>
            <input id="mu2" name="multiple" class="easyui-textbox" style="width:50%;height:32px">
          </li>
          <li>
            <input id="mu3" name="multiple" class="easyui-textbox" style="width:50%;height:32px">
          </li>

        </ol>-->
      </div>
      <input type="submit" value="下一步" class="easyui-linkbutton c4" style="width:120px">
    </form>

  </div>
</div>
<script type="text/javascript">
  //添加单选病情
  function addsingle() {
    var html = "<li><input name='single' class='easyui-textbox' style='width:50%;height:32px'></li> ";
    var targetObj = $(html).appendTo("#si");
    $.parser.parse(targetObj.parent);
  }
  /*//添加多选病情
  function addmulti() {
    var html = "<li><input name='multiple' class='easyui-textbox' style='width:50%;height:32px'></li> ";
    var targetObj = $(html).appendTo("#mu");
    $.parser.parse(targetObj.parent);
  }*/


  function submitForm() {
    //ajax方式提交表单
    $("#ff").ajaxSubmit(function (message) {//提交成功的回调函数
       console.log(message);
      var tab = $('#tt').tabs('getSelected');  // get selected panel
      $('#tt').tabs('update', {
        tab: tab,
        options: {
          title: '添加病症详情',
          content: message  // the new content URL
        }
      });

    });
    return false;
  }

  function clearForm() {
    $('#ff').form('clear');
  }

</script>
</body>